#!/bin/sh
# script config Infondlinux
# distributed under New BSD Licence
# created by t0ka7a
# version 0.5
# 2011-04-10
# this script provides a post-installation on Ubuntu
# careful: the script closes current firefox instances.

# debian packages
# - imagemagick
# - vim 
# - less 
# - gimp
# - build-essential 
# - wipe 
# - xchat 
# - pidgin 
# - vlc 
# - nautilus-open-terminal
# - nmap
# - zenmap
# - sun-java6-plugin et jre et jdk
# - bluefish
# - flash-plugin-nonfree
# - aircrack-ng
# - wireshark
# - ruby
# - ascii
# - webhttrack
# - socat
# - nasm
# - w3af
# - subversion
# - wireshark
# - mercurial
# - libopenssl-ruby
# - ruby-gnome2
# - traceroute
# - filezilla
# - gnupg
# - rubygems
# - php5
# - libapache2-mod-php5
# - mysql-server 
# - php5-mysql
# - phpmyadmin
# - extract
# - p0f
# - spikeproxy
# - ettercap
# - dsniff :
#	* arpspoof - Send out unrequested (and possibly forged) arp replies.
#	* dnsspoof - forge replies to arbitrary DNS address / pointer queries on the Local Area Network.
#	* dsniff - password sniffer for several protocols.
#	* filesnarf - saves selected files sniffed from NFS traffic.
#	* macof - flood the local network with random MAC addresses.
#	* mailsnarf - sniffs mail on the LAN and stores it in mbox format.
#	* msgsnarf - record selected messages from different Instant Messengers.
#	* sshmitm - SSH monkey-in-the-middle. proxies and sniffs SSH traffic.
#	* sshow - SSH traffic analyser.
#	* tcpkill - kills specified in-progress TCP connections.
#	* tcpnice - slow down specified TCP connections via “active” traffic shaping.
#	* urlsnarf - output selected URLs sniffed from HTTP traffic in CLF.
#	* webmitm - HTTP / HTTPS monkey-in-the-middle. transparently proxies.
#	* webspy - sends URLs sniffed from a client to your local browser
# - unrar
# - torsocks
# - secure-delete
# - nautilus-gksu
# - sqlmap
# - john the ripper

# third party packages
# - tor
# - tor-geoipdb
# - virtualbox 4.0
# - google-chrome-stable

# manually downloaded softwares and version
# - DirBuster (1.0RC1)
# - truecrypt (7.0a)
# - metasploit framework (3.6)
# - webscarab (latest)
# - burp suite (1.3.03)
# - parosproxy (3.2.13)
# - jmeter (2.4)
# - rips (0.35)
# - origami-pdf (latest)
# - pdfid.py (0.0.11)
# - pdf-parser.pym (0.3.7)
# - fierce (latest)
# - wifite (latest)
# - pyloris (3.2)
# - skipfish (1.86 beta)
# - hydra (6.2)
# - Maltego (3.0)
# - set
# - volatilty (1.3 beta)

# home made scripts
# - hextoasm
# - md5crack.py (written by Corbiero)
# - chartoascii.py
# - asciitochar.py
# - rsa.py

# firefox extensions
# - livehttpheaders 
# - firebug 
# - tamperdata 
# - noscript 
# - flashblock 
# - flashgot 
# - foxyproxy
# - certificatepatrol
# - chickenfoot 1.0.7

######################################################
# trick to know: to share the current directory:
# $ sudo python -m SimpleHTTPServer 8080
######################################################



#####################################
# define extension directory for mozilla firefox
#####################################

mozillaApplicationId="$(ls /usr/share/mozilla/extensions)"
extensionDir="/usr/share/mozilla/extensions/$mozillaApplicationId"


#####################################
# function log()
#####################################
# write in /usr/share/Infond/log/install.log
# @param1: type '+' or 'E' or 'I'
# @param2: 'message' 
log() (
  echo $1": $(date +%D' '%R':'%S) "$2 >> /usr/share/Infond/log/install.log
  echo $1": $(date +%D' '%R':'%S) "$2 > /dev/stdout
)

###########################
# function addBinEntry()
###########################
# adds a file .sh with the command line in the application directory
# adds a symbolic link in /usr/bin
# param1: name of the application
# param2: command line
# param3: term (default=NULL). To start the application in a new term 
# ex: addBinEntry dirbuster "java -jar /usr/share/Infond/bin/DirBuster-1.0-RC1/DirBuster-1.0-RC1.jar" term
#     creates a file dirbuster.sh in /usr/share/Infond/bin
addBinEntry() (
  # exit if file already in /usr/bin
  if [ -z $(ls /usr/share/Infond/bin | grep $1.sh ) ]; then
    echo "#!/bin/sh" > /usr/share/Infond/bin/$1.sh
    echo "" >> /usr/share/Infond/bin/$1.sh
    echo "# $1.sh" >> /usr/share/Infond/bin/$1.sh
    echo "# generated by Infond post installation Infond" >> /usr/share/Infond/bin/$1.sh
    echo "# launcher to start $1 in a terminal" >> /usr/share/Infond/bin/$1.sh
    echo "# a symbolic link was created in /usr/bin" >> /usr/share/Infond/bin/$1.sh

    # run application from terminal if $4 set to 'term'
    if ( [ ! -z $3 ] && [ $3 = 'term' ] ); then 
      echo "gnome-terminal --title=$1 --working-directory=\"/tmp\" --command=\"$2\"" >> /usr/share/Infond/bin/$1.sh
    else
      echo "$2" >> /usr/share/Infond/bin/$1.sh
    fi

    # log
    log "+" "$1.sh created in /usr/share/Infond/bin/."

    # make $1.sh executable
    chmod +x /usr/share/Infond/bin/$1.sh 
    log "+" "$1.sh chmod +x"

  else
    log "I" "$1 already in /usr/share/Infond/bin. Not added."
  fi

  # create symbolic link in /usr/bin
  if [ -z $(ls /usr/bin | grep $1 ) ]; then
    ln -s /usr/share/Infond/bin/$1.sh /usr/bin/$1
    log "+" "symbolic link to $1.sh created in /usr/bin/."
  else
    log "I" "$1 already in /usr/bin. Not added." && return 1
  fi
)

#####################################
# function aptremove()
#####################################
# remove package using apt
aptremove() ( 
  # if package not installed
  [ -z "$(dpkg --list $1 | grep ii)" ] && log "I" "$1 not installed. can't be removed" && return 1
  # remove package
  apt-get --auto-remove -y --allow-unauthenticated remove $1
  # if package well removed
  [ -z "$(dpkg --list $1 | grep ii)" ] && log "+" "$1 removed"   
)

#####################################
# function aptinstall()
#####################################
# install package using apt
aptinstall() (
  # if package already installed 
  [ ! -z "$(dpkg --list $1 | grep ii)" ] && log "I" "$1 already installed. can't be installed" && return 1
  # install package
  apt-get --auto-remove -y --allow-unauthenticated install $1 
  # if package well installed
  [ ! -z "$(dpkg --list $1 | grep ii)" ] && log "+" "$1 installed"
)

#################################
# function firefoxadd()
#################################
# download firefox extension .xpi into ~/.mozilla/firefox/*.default/extensions/
# it is possible to install extension into /usr/lib/firefox-addons/extensions
# firefox will install it at next start
# @param1: name of the extension
# @param2: number of extension on addons.mozilla.org 
firefoxadd() (
  if [ -z "$(ls -R $extensionDir | grep $1)" ]; then 
    # download
    wget https://addons.mozilla.org/en-US/firefox/downloads/latest/$2/addon-$2-latest.xpi -nc -P $extensionDir
   # log
   log "+" "$1 firefox extension installed."
  else
   log "I" "$1 firefox extension already installed. .xpi not downloaded."
  fi
)

###########################
# function downloadicon()
###########################
# download picture and create icon
# @param1: name for the icon
# @param2: downloading address
# ex: downloadicon msf http://metasploit.com/icon.jpg
downloadicon() (
  if [ -z "$(ls /usr/share/Infond/pictures | grep $1.png )" ]; then
    wget $2 -P /tmp
    convert -size 48x48 /tmp/$(echo $2|awk -F/ '{print $NF}') -resize 48x48 -extent 48x48 +profile '*' /usr/share/Infond/pictures/$1.png
    log "+" "$1 icon downloaded"
    rm /tmp/$(echo $2|awk -F/ '{print $NF}')
  else
    log "I" "$1 icon already exists. Not downloaded."
  fi
)

###########################
# function addmenu()
###########################
# add an entry to gnome menu
# @param1: name
# @param2: comment
# @param3: command line
# @param4: terminal (true or false)
# @param5: categorie
addmenu() (
  if [ -z "$(ls /usr/share/applications | grep $1.desktop)" ];then
    echo "
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=$1
Comment=$2
Icon=/usr/share/Infond/pictures/$1.png
Exec=$3
Terminal=$4
Categories=$5
" > /usr/share/applications/$1.desktop
    log "+" "$1.desktop created"
  else
    log "I" "$1.desktop already exists. Not updated."
  fi
)


###########################
# function addcategory()
###########################
# add a category to .desktop file
# @param1: name
# @param2: category
addcategory() (
  if [ -z "$(cat /usr/share/applications/$1.desktop | grep Categories | grep $2)"]; then
    # replace all Categories entries by $2. Ex: Categories=Network;GTK => Categories=Transport;
    sed -i "s/Categories.*/Categories=$2;/" /usr/share/applications/$1.desktop
    # add $2 to Categories entries. Ex: Categories=Network;GTK => Categories=Network;GTK;Transport;
    #[ -z $(cat /usr/share/applications/$1.desktop | grep $2) ] && sed -i "/Categories/s|$|;$2;|" /usr/share/applications/$1.desktop
    log "+" "$2 put in Categories in $1.desktop"
  else
    log "I" "$2 already in Categories in $1.desktop"
  fi
)

###########################
# function adddirectory()
###########################
# add a directory entry in /usr/share/desktop-directories
# this directory entry will be used in /etc/xdg/menus/applications.menu
# it needs an icon. You can use downloadicon function
# @param: name for the directory entry

adddirectory() (
if [ -z "$(ls /usr/share/desktop-directories | grep $1.directory)" ]; then
  echo "[Desktop Entry]
Name=$1
Comment=$1 tools
Icon=/usr/share/Infond/pictures/$1.png
Type=Directory
Categories=$1
" > /usr/share/desktop-directories/$1.directory
  log "+" "$1.directory written"
else
  log "I" "$1.directory already exists. Not updated."
fi
)

#####################################
# installation start
#####################################
# test sudo
[ $(id -u) -ne "0" ] && echo "You must be sudo to use this script." && exit 1

# mode verbose
#set -v
1>/dev/null
2>/dev/null

# catch CTRL-C
trap "echo ''; echo CTR-C was pressed. Exit; log 'E' 'CTRL-C pressed.; exit 1" 2

# create install directory
if [ -z "$(ls /usr/share | grep Infond)" ]; then
  mkdir /usr/share/Infond
  mkdir /usr/share/Infond/bin
  mkdir /usr/share/Infond/pictures
  mkdir /usr/share/Infond/log
fi

# create log file if not already created
echo "****************" >> /usr/share/Infond/log/install.log
log "+" "install begin"
echo "****************" >> /usr/share/Infond/log/install.log

##############################
# 1st start
###############################

# if dist-upgrade not done yet
if [ -z "$(cat /usr/share/Infond/log/install.log | grep dist-upgrade )" ]; then

  # dist-upgrade
  apt-get --auto-remove -y --allow-unauthenticated dist-upgrade

  # update log
  log "+" "dist-upgrade"

  # reboot
  echo "System will reboot. Please restart script after reboot"
  read pause 

  # reboot
  log "I" "reboot"
  reboot
fi


#################################
# further installs
#################################

# close firefox (necessary to install firefox extensions)
[ ! -z $(pidof firefox-bin) ] && kill -9 $(pidof firefox-bin)

#################################
# apt
#################################

# add Commercial repository
if [ -z "$(cat /etc/apt/sources.list | grep Commercial)" ]; then
  echo "" >> /etc/apt/sources.list
  echo "## Commercial" >> /etc/apt/sources.list
  echo "deb http://archive.canonical.com/ubuntu $(lsb_release -sc) partner " >> /etc/apt/sources.list
  log "+" "repository Commercial added to apt sources list"
else
  log "I" "repository Commercial already in apt sources list. Not added"
fi

# add torproject repository
if [ -z "$(cat /etc/apt/sources.list | grep torproject)" ]; then
  echo "" >> /etc/apt/sources.list
  echo "## tor" >> /etc/apt/sources.list
  echo "deb http://deb.torproject.org/torproject.org $(lsb_release -sc) main" >> /etc/apt/sources.list
  gpg --keyserver keys.gnupg.net --recv 886DDD89
  gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
  log "+" "repository torproject added to apt sources list"
else
  log "I" "repository torproject already in apt sources list. Not added"
fi

# add non-free repository to apt
if [ -z "$(cat /etc/apt/sources.list | grep virtualbox)" ]; then
  echo "" >> /etc/apt/sources.list
  echo "## virtualbox" >> /etc/apt/sources.list
  echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" >> /etc/apt/sources.list
  apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 98AB5139  
  log "+" "virtualbox added to apt sources list"
else
  log "I" "virtualbox already in apt sources list. Not added"
fi

# add google repository
if [ -z "$(cat /etc/apt/sources.list | grep google)" ]; then
  echo "" >> /etc/apt/sources.list
  echo "## google" >> /etc/apt/sources.list
  echo "deb http://dl.google.com/linux/deb/ stable main" >> /etc/apt/sources.list
  wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
  log "+" "google added to apt sources list"
else
  log "I" "google already in apt sources list. Not added"
fi


# update
apt-get update > /dev/null
log "+" "apt-get update"
apt-get upgrade -y
log "+" "apt-get upgrade"

# apt remove useless packages
aptremove gwibber
aptremove empathy
aptremove gbrainy
aptremove f-spot
aptremove evolution
aptremove quadrapassel
aptremove totem

# apt install
aptinstall imagemagick
aptinstall vim
aptinstall less
aptinstall build-essential
aptinstall gimp
aptinstall tor
aptinstall tor-geoipdb
aptinstall vlc
aptinstall nautilus-open-terminal
aptinstall sun-java6-plugin 
aptinstall sun-java6-jdk
aptinstall flashplugin-nonfree
aptinstall bluefish
aptinstall xchat
aptinstall pidgin
aptinstall ruby
aptinstall nasm
aptinstall subversion
aptinstall traceroute
aptinstall filezilla
aptinstall gnupg
aptinstall unrar
aptinstall secure-delete
aptinstall nautilus-gksu

# add category to .desktop
addcategory bluefish Accessories
addcategory xchat Accessories
addcategory pidgin Accessories

##################################
# menu GNOME
##################################

# see $ gnome-help , (search for keyword ".desktop")

# add pictures (if not already in directory)
downloadicon Infond http://3.bp.blogspot.com/_Jna6k5HsSu4/TDH4lKIz1cI/AAAAAAAAAHc/a-P6uy2wHjI/s1600/Infond48x48.jpg
downloadicon Pentest http://3.bp.blogspot.com/_Jna6k5HsSu4/TDMceNplaqI/AAAAAAAAAHs/iWG1MOPS0uw/s320/pentest.png
downloadicon Forensics http://2.bp.blogspot.com/_Jna6k5HsSu4/THY3np27VLI/AAAAAAAAAH8/S2UXa4CsjB8/s1600/forensics.jpg
downloadicon pdf http://3.bp.blogspot.com/_Jna6k5HsSu4/THY4kUhlzkI/AAAAAAAAAIE/ShLrs-iI2rs/s1600/pdf.png
downloadicon Transport http://www.bluemelon.org/images/1/1c/Wire-black.gif
downloadicon Ddos http://www.peacelab.org/pictures/nuclear_bomb.jpg

# add directory entries in /usr/share/Infond/desktop-directories
adddirectory Infond
adddirectory Pentest
adddirectory Forensics
adddirectory pdf
adddirectory Transport
adddirectory Ddos

# modify /etc/xdg/menus/applications.menu
# the directory /etc/xdg is in $XDG_CONFIG_DIRS (see $ gnome-help)
if [ -z "$( cat /etc/xdg/menus/applications.menu | grep Infond.directory )" ]; then
  sed -i '/<!-- Accessories submenu -->/i\
  \
  <!-- Infond submenu -->\
  <Menu>\
    <Name>Infond</Name>\
    <Directory>Infond.directory</Directory>\
    <Menu>\
      <Name>Ddos</Name>\
      <Directory>Ddos.directory</Directory>\
      <Include>\
        <And>\
          <Category>Ddos</Category>\
        </And>\
      </Include>\
    </Menu>\
    <Menu>\
      <Name>Pentest</Name>\
      <Directory>Pentest.directory</Directory>\
      <Include>\
        <And>\
          <Category>Pentest</Category>\
        </And>\
      </Include>\
      <Menu>\
        <Name>Transport</Name>\
        <Directory>Transport.directory</Directory>\
        <Include>\
          <And>\
            <Category>Transport</Category>\
          </And>\
        </Include>\
      </Menu>\
    </Menu>\
    <Menu>\
      <Name>Forensics</Name>\
      <Directory>Forensics.directory</Directory>\
       <Menu>\
          <Name>pdf</Name>\
          <Directory>pdf.directory</Directory>\
          <Include>\
            <And>\
              <Category>pdf</Category>\
            </And>\
          </Include>\
       </Menu>\
       <Include>\
        <And>\
          <Category>Forensics</Category>\
        </And>\
      </Include>\
    </Menu>\
    <Menu>\
      <Name>Accessories</Name>\
      <Directory>Utility.directory</Directory>\
      <Include>\
        <And><Category>Accessories</Category></And>\
      </Include>\
    </Menu>\
  </Menu>\
  ' /etc/xdg/menus/applications.menu
  log "+" "applications.menu modified"
else
  log "I" "applications.menu already correct. Not modified."
fi

##################################
# google-chrome
##################################

# download and install
aptinstall google-chrome-stable


#################################
# sqlmap
#################################

aptinstall sqlmap

downloadicon sqlmap http://papaismurf.net/wp-content/uploads/2010/10/sqlmap.jpg

addmenu sqlmap "sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of back-end database servers." "bash -c 'cd /tmp;sqlmap -h;bash'" "true" "Pentest"

##################################
# spikeproxy
##################################

aptinstall spikeproxy

downloadicon spikeproxy http://icon.downv.com/32x32/5/71/1035076.f8375b2ff667dd9e260527fa6a173b94.gif

addmenu spikeproxy "web application auditing tool." "bash -c 'gnome-terminal -e \"sudo spikeproxy\";google-chrome --proxy-server=localhost:8080 http://spike'" "false" "Pentest"

##################################
# torsocks
##################################

aptinstall torsocks

downloadicon usewithtor http://check.torproject.org/images/tor-on.png

addmenu usewithtor "Torsocks allows you to use most socks-friendly applications in a safe way with Tor." "bash -c 'cd /tmp;echo usewithtor [application [application arguments]];usewithtor -h;bash'" "true" Transport

##################################
# ettercap
##################################

aptinstall ettercap-gtk
addcategory ettercap Transport



##################################
# nmap
##################################

# apt install
aptinstall nmap

# download icon
downloadicon nmap http://www.ansi.tn/gfx/nmap.png

# add entry in Gnome menu
addmenu nmap "Nmap (\"Network Mapper\") is a free and open source utility for network exploration or security auditing." "bash -c 'cd /tmp;nmap -h;nmap -V;bash'" "true" Transport


##################################
# zenmap
##################################

aptinstall zenmap
downloadicon zenmap http://www.ansi.tn/gfx/nmap.png
rm /usr/share/applications/zenmap-root.desktop
rm /usr/share/applications/zenmap.desktop
addmenu zenmap "Nmap (\"Network Mapper\") is a free and open source utility for network exploration or security auditing." "bash -c 'cd /tmp;gnome-terminal -e \"sudo zenmap\"'" "false" Transport

##################################
# dsniff
##################################

#	* arpspoof - Send out unrequested (and possibly forged) arp replies.
#	* dnsspoof - forge replies to arbitrary DNS address / pointer queries on the Local Area Network.
#	* dsniff - password sniffer for several protocols.
#	* filesnarf - saves selected files sniffed from NFS traffic.
#	* macof - flood the local network with random MAC addresses.
#	* mailsnarf - sniffs mail on the LAN and stores it in mbox format.
#	* msgsnarf - record selected messages from different Instant Messengers.
#	* sshmitm - SSH monkey-in-the-middle. proxies and sniffs SSH traffic.
#	* sshow - SSH traffic analyser.
#	* tcpkill - kills specified in-progress TCP connections.
#	* tcpnice - slow down specified TCP connections via “active” traffic shaping.
#	* urlsnarf - output selected URLs sniffed from HTTP traffic in CLF.
#	* webmitm - HTTP / HTTPS monkey-in-the-middle. transparently proxies.
#	* webspy - sends URLs sniffed from a client to your local browser

aptinstall dsniff

downloadicon arpspoof http://school.discoveryeducation.com/clipart/images/harp.gif
addmenu arpspoof "intercept packets on a switched LAN." "bash -c 'cd /tmp;arpspoof;bash'" "true" Transport
downloadicon dnsspoof http://bio3d.colorado.edu/tor/sadocs/dns/dns-1.png
addmenu dnsspoof "forge replies to DNS address / pointer queries." "bash -c 'cd /tmp;dnsspoof -h;bash'" "true" Transport
downloadicon dsniff http://blog.pastoutafait.org/dotfiles/public/images/securite/dsniff-logo.png
addmenu dsniff "password sniffer." "bash -c 'cd /tmp;dsniff -h;bash'" "true" Transport
downloadicon filesnarf http://i1-news.softpedia-static.com/images/extra/LINUX/large/protechone-large_014.png
addmenu filesnarf "sniff files from NFS traffic." "bash -c 'cd /tmp;filesnarf -h;bash'" "true" Transport
downloadicon macof http://www.cisco.com/en/US/i/100001-200000/140001-150000/148001-149000/148494.jpg
addmenu macof "flood a switched LAN with random MAC addresses." "bash -c 'cd /tmp;macof -h;bash'" "true" "Ddos"
downloadicon mailsnarf http://www.monnaieservices.org/Images/mail.jpg
addmenu mailsnarf "sniff mail messages in Berkeley mbox format." "bash -c 'cd /tmp;mailsnarf -h;bash'" "true" Transport
downloadicon msgsnarf http://fr.academic.ru/pictures/frwiki/49/120px-Cat-eating-prey.jpg
addmenu msgsnarf "sniff chat messages." "bash -c 'cd /tmp;msgsnarf -h;bash'" "true" Transport
downloadicon sshmitm http://a.images.blip.tv/G0tmi1k-ManInTheMiddleMITMAttack698.gif
addmenu sshmitm "SSH monkey-in-the-middle." "bash -c 'cd /tmp;sshmitm -h;bash'" "true" Transport
downloadicon sshow http://android.smartphonefrance.info/news/unlock.jpg
addmenu sshmitm "SSH traffic analysis tool." "bash -c 'cd /tmp;sshow -h;bash'" "true" Transport
downloadicon tcpkill http://www.appetitebooks.ca/images/cms/Image/Knife.jpg
addmenu tcpkill "kill TCP connections on a LAN." "bash -c 'cd /tmp;tcpkill -h;bash'" "true" "Ddos"
downloadicon tcpnice http://www.helleniccommunity.com/youth/images/snail.gif
addmenu tcpnice "slow down TCP connections on a LAN." "bash -c 'cd /tmp;tcpnice -h;bash'" "true" "Ddos"
downloadicon urlsnarf http://static.pcinpact.com/images/bd/news/mini-69414-http-world-wide-web-www.jpg
addmenu urlsnarf "sniff HTTP requests in Common Log Format." "bash -c 'cd /tmp;urlsnarf -h;bash'" "true" Transport
downloadicon webmitm http://www.linux-france.org/prj/inetdoc/securite/tutoriel/images/middle.png
addmenu webmitm "HTTP / HTTPS monkey-in-the-middle." "bash -c 'cd /tmp;webmitm -h;bash'" "true" Transport
downloadicon webspy http://www.chezcarriere.com/images/logo_Netscape.gif
addmenu webspy "display sniffed URLs in Netscape in real-time." "bash -c 'cd /tmp;webspy -h;bash'" "true" Transport


##################################
# skipfish
##################################

aptinstall skipfish

downloadicon skipfish http://img.maxisciences.com/google/logo-google_12964_w250.jpg

addmenu skipfish "A fully automated, active web application security reconnaissance tool." "bash -c 'cd /tmp; skipfish -h;bash'" "true" "Pentest"

##################################
# maltego
##################################

wget http://www.paterva.com/malv3/MaltegoCESetup.v3.0.936.deb -nc -P /tmp
aptinstall gdebi
gdebi -n /tmp/Maltego*
log "+" "maltego installed"


##################################
# set
##################################

if [ -z "$(ls /usr/share/Infond/bin | grep set)" ]; then
  svn co http://svn.secmaniac.com/social_engineering_toolkit /usr/share/Infond/bin/set
  python /usr/share/Infond/bin/set/setup.py install
  log "+" "set installed"
else
  log "I" "set already in /usr/share/Infond/bin. Not downloaded."
fi

downloadicon 'set' http://www.secmaniac.com/wp-content/uploads/2010/09/set-small-card1.png

addBinEntry 'set' "sudo bash /usr/share/Infond/bin/set/set"

addmenu 'set' "The social engineer toolkit." 'set' "true" "Pentest"


##################################
# volatility
##################################

if [ -z "$(ls /usr/local/bin | grep Volatility)" ]; then
  wget https://www.volatilesystems.com/volatility/1.3/Volatility-1.3_Beta.tar.gz _nc -P /tmp
  tar xzf /tmp/Volatility-1.3_Beta.tar.gz -C /usr/share/Infond/bin
  log "+" "volatility downloaded"
else
  log "I" "volatility already in /usr/share/Infond/bin. Not downloaded."
fi

downloadicon volatility http://cert.lexsi.com/weblog/images/forensics2.jpg

addBinEntry volatility "python /usr/share/Infond/bin/Volatility*/volatility \$*"

addmenu volatility "The Volatility Framework is a completely open collection of tools for the extraction of digital artifacts from volatile memory (RAM) samples." "bash -c 'cd /tmp; volatility ;bash'" "true" "Forensics"


##################################
# hydra
##################################

aptinstall libssh-dev
aptinstall libpq-dev
aptinstall libncp-dev

if [ -z "$(ls /usr/local/bin | grep hydra)" ]; then
  wget http://freeworld.thc.org/releases/hydra-6.2-src.tar.gz -nc -P /tmp
  tar xzf /tmp/hydra* -C /tmp
  bash -c 'cd /tmp/hydra-6.2-src; ./configure; make; make install' 
  rm /tmp/hydra*
  log "+" "hydra compiled and installed"
else
  log "I" "hydra already in /usr/share/Infond/bin. Not downloaded."
fi

downloadicon hydra http://www.taraduncan-livre.com/wp-content/uploads/2009/04/tara-duncan-familier-hydre-familier-robin.jpg

addmenu hydra "A very fast network logon cracker which support many different services." "bash -c 'cd /tmp; hydra ;bash'" "true" "Pentest"


##################################
# pyLoris 3.2
##################################

if [ -z "$(ls /usr/share/Infond/bin | grep pyloris)" ]; then
  wget http://downloads.sourceforge.net/project/pyloris/pyloris/3.2/pyloris-3.2.tgz -nc -P /tmp
  tar xzf /tmp/pyloris-3.2.tgz -C /usr/share/Infond/bin
  rm /tmp/pyloris*
  log "+" "pyloris downloaded"
else
  log "I" "pyloris already in /usr/share/Infond/bin. Not downloaded."
fi

downloadicon pyloris http://aphs.worldnomads.com/jamesanddan/3493/SlowLoris.jpg

addBinEntry pyloris "python /usr/share/Infond/bin/pyloris-3.2/pyloris.py"

addmenu pyloris "PyLoris is a scriptable tool for testing a web server's vulnerability to Denial of Service (DoS) attacks which supports SOCKS, SSL, and all HTTP request methods." pyloris "true" "Ddos"



##################################
# extract
##################################

aptinstall extract
downloadicon extract http://seo-hacker.com/wp-content/uploads/2010/05/Meta-tags.jpg
addmenu extract "determine meta-information about a file/" "bash -c 'cd /tmp;extract -h;echo ex: $ extract test/test.jpg;bash'" "true" "Forensics"


##################################
# w3af
##################################

# apt install
aptinstall w3af

# add entry in Gnome menu
addcategory w3af Pentest

##################################
# wireshark
##################################

# apt install
aptinstall wireshark

# add entry in Gnome menu
addcategory wireshark Pentest


##################################
# md5crack.py - written by Corbiero
##################################

echo '
import urllib, re , sys

# tool written by Corbiero
# 2010

# md5crack.com
params = urllib.urlencode({"term": sys.argv[1]})
print "Try to crack "+ sys.argv[1] +" on md5crack.com"
f = urllib.urlopen("http://md5crack.com/crackmd5.php", params)
y = f.read()
if re.match("(.*)Found: (.*)</div>\\n(.*)",y,re.DOTALL):
	print re.match("(.*)Found: (.*)</div>\\n(.*)",y,re.DOTALL).group(2)
	
# passcracking.com
params = urllib.urlencode({"datafromuser": sys.argv[1]})
print "Try to crack "+ sys.argv[1] +" on passcracking.com"
f = urllib.urlopen("http://passcracking.ru/index.php", params)
y = f.read()
if re.match("(.*)<td>md5 Database</td><td>(.*)</td><td bgcolor=#FF0000>(.*)</td><td>",y,re.DOTALL):
	print "Password: " + re.match("(.*)<td>md5 Database</td><td>(.*)</td><td bgcolor=#FF0000>(.*)</td><td>",y,re.DOTALL).group(3)
	
# md5.my-addr.com
params = urllib.urlencode({"md5": sys.argv[1]})
print "Try to crack "+ sys.argv[1] +" on md5.my-addr.com"
f = urllib.urlopen("http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php", params)
y = f.read()
if re.match("(.*)Hashed string</span>: (.*)</div>\\n<br>(.*)",y,re.DOTALL):
	print "Password: " + re.match("(.*)Hashed string</span>: (.*)</div>\\n<br>(.*)",y,re.DOTALL).group(2)
' > /usr/share/Infond/bin/md5crack.py

addBinEntry md5crack "python /usr/share/Infond/bin/md5crack.py \$1"

downloadicon md5crack http://www.hamza.ma/wp-content/uploads/2008/07/cracker.jpg

addmenu md5crack "md5crack is a tool written in Python by Corbiero. It sends a request to different websites which provide plain text given a md5 hash." "bash -c 'cd /tmp;echo example: $ md5crack 286755fad04869ca523320acce0dc6a4;bash;'" "true" "Accessories" 

##################################
# chartoascii.py - written by Corbiero
##################################

echo "
import sys
# script to encode a string in ascii
output = '0x'
for c in sys.argv[1]:
	output += str(hex(ord(c))[2:])
print output
" > /usr/share/Infond/bin/chartoascii.py

addBinEntry chartoascii "python /usr/share/Infond/bin/chartoascii.py \$1"

downloadicon chartoascii http://www.prntrkmt.org/hieroglyphs/monoliterals/pict/bwvulture.gif

addmenu chartoascii "script to encode a string in ascii." "bash -c 'cd /tmp;echo example: $ chartoascii mystring;bash;'" "true" "Accessories" 

##################################
# asciitochar.py
##################################

echo "
import sys
# usage:
# asciitochar.py 0x6262626262
h = sys.argv[1][2:]
result = ''
for i in range(0,len(h),2):
	c = ''+h[i]+h[i+1]
	result += chr(int(''+h[i]+h[i+1],16))
print result
" > /usr/share/Infond/bin/asciitochar.py

addBinEntry asciitochar "python /usr/share/Infond/bin/asciitochar.py \$1"

downloadicon asciitochar http://www.prntrkmt.org/hieroglyphs/monoliterals/pict/bwvulture.gif

addmenu asciitochar "script to encode a string in ascii." "bash -c 'cd /tmp;echo example: $ asciitochar 0x64636263;bash;'" "true" "Accessories" 


##################################
# hextoasm
##################################
# script to print asm instructions from a hex string
echo 'usage() (
  echo "********************************************************"
  echo "* script adapted from a tip by ivanlef0u               *"
  echo "* written by t0ka7a for Infondlinux                    *"
  echo "* http://Infond.blogspot.com                           *"
  echo "*                                                      *"
  echo "* prints asm instructions from an hex strings          *"
  echo "*                                                      *"
  echo "* ex:                                                  *"
  echo "* $ hextoasm "\x90\x31\x90\x90\xea\x42\x42\x42"        *"
  echo "* 00000000  90                nop                      *"
  echo "* 00000001  319090EA4242      xor \eax+0x4242ea90],edx *"
  echo "* 00000007  42                inc edx                  *"
  echo "********************************************************"
  echo
)

# help
[ $1 = "-h" ] && usage && exit 0

# test nb of arguments
[ $# != 1 ] && echo one argument needed && exit -1

# test nasm installed
[ -z "$(dpkg --list nasm | grep ii)" ] && echo "please install nasm:  apt-get install nasm" && exit -1

python -c "print \"$1\"" | tr -d "\r\n" | ndisasm -u -
' > /usr/share/Infond/bin/hextoasm
chmod +x /usr/share/Infond/bin/hextoasm
ln -s /usr/share/Infond/bin/hextoasm /usr/bin/hextoasm

# download icon
downloadicon hextoasm http://info.sio2.be/python/1/images/assembler.png
 
# add entry in Gnome menu for hextoasm
addmenu hextoasm "prints asm instructions from an hex strings ." "bash -c 'cd /tmp;hextoasm -h;bash'" "true" "Accessories"

##################################
# rsa.py
##################################
#source: http://www.amk.ca/python/writing/crypto-curiosa


echo "#!/usr/local/bin/python 
from sys import*;from string import*;a=argv;[s,p,q]=filter(lambda x:x[:1]!=
'-',a);d='-d'in a;e,n=atol(p,16),atol(q,16);l=(len(q)+1)/2;o,inb=l-d,l-1+d
while s:s=stdin.read(inb);s and map(stdout.write,map(lambda i,b=pow(reduce(
lambda x,y:(x<<8L)+y,map(ord,s)),e,n):chr(b>>8*i&255),range(o-1,-1,-1)))
" > /usr/share/Infond/bin/rsa.py

# add bin entry
addBinEntry rsa.py "python /usr/share/Infond/bin/rsa.py \$1 \$2 \$3"

# download icon
downloadicon rsa http://fr.academic.ru/pictures/frwiki/82/RSA_Security_logo_CMYK.jpg
 
# add entry in Gnome menu
addmenu rsa.py "encrypt:   echo  Top secret message. | rsa.py 10001 1967cb529 >ciphertext     decrypt:   cat ciphertext | rsa.py -d ac363601 1967cb529" "bash -c 'cd /tmp;echo \"encrypt:   echo  Top secret message. | rsa.py 10001 1967cb529 >ciphertext     decrypt:   cat ciphertext | rsa.py -d ac363601 1967cb529\";bash;'" "true" "Accessories" 



##################################
# origami-pdf
##################################
aptinstall mercurial
aptinstall libopenssl-ruby
aptinstall ruby-gnome2
if [ -z "$(ls /usr/share/Infond/bin | grep origami-pdf)" ]; then
  hg clone https://origami-pdf.googlecode.com/hg/ /usr/share/Infond/bin/origami-pdf
  cp -r /usr/share/Infond/bin/origami-pdf/origami* /usr/lib/ruby/1.8
  chown -R root: /usr/lib/ruby/1.8/origami
  log "+" "origami-pdf installed"
else
  log "I" "origami-pdf already in /usr/share/Infond/bin. Not downloaded."
fi

downloadicon origami http://1.bp.blogspot.com/_Jna6k5HsSu4/THY_Oo1e1dI/AAAAAAAAAIM/8RVTDhG3d98/s200/origami.jpg

addmenu origami "ruby framework for pdf generation" "bash -c 'cd /tmp;cat /usr/share/Infond/bin/origami-pdf/README;echo samples available in /usr/share/Infond/bin/origami-pdf/samples;bash'" "true" pdf


##################################
# dirBuster                      #
##################################

# install
if [ -z "$(ls /usr/share/Infond/bin | grep DirBuster)" ]; then
  wget "http://downloads.sourceforge.net/project/dirbuster/DirBuster%20%28jar%20%2B%20lists%29/1.0-RC1/DirBuster-1.0-RC1.tar.bz2" -nc -P /tmp
  tar xjvf /tmp/DirBuster* -C /usr/share/Infond/bin
  rm -r /tmp/DirBuster*
  log "+" "dirbuster downloaded"
else
  log "I" "dirbuster already in /usr/share/Infond/bin. Not downloaded."
fi

# download icon
downloadicon dirbuster http://a.fsdn.com/con/icons/di/dirbuster@sf.net/ologo.gif 

# create dirbuster.sh and add dirbuster.sh shortcut in /usr/bin
addBinEntry dirbuster "java -jar /usr/share/Infond/bin/DirBuster-0.12/DirBuster-0.12.jar"

# add entry in Gnome menu for DirBuster
addmenu dirbuster "DirBuster is a multi threaded java application designed to brute force directories and files names on web/application servers. Often is the case now of what looks like a web server #in a state of default installation is actually not, and has pages and applications hidden within. DirBuster attempts to find these." dirbuster "false" "Pentest"


##################################
# bboxkeys
##################################

if [ -z "$(ls /usr/share/Infond/bin | grep bboxkeys)" ]; then
  wget "https://docs.google.com/uc?id=0B-dlin-yvm82MGViYjQ5NzktMmZiYi00YTFjLThjNDQtN2M1NDM0NDI1NmJj&export=download&hl=fr" -nc -O /usr/share/Infond/bin/bboxkeys
  chmod +x /usr/share/Infond/bin/bboxkeys
fi

downloadicon bboxkeys http://www.giiks.com/images/bbox/logo-bbox-baseline.jpg
addBinEntry bboxkeys /usr/share/Infond/bin/bboxkeys
addmenu bboxkeys "Bouygues Telecom Bbox default WPA key Generator" "bash -c 'cd /tmp;bboxkeys;bash;'" "true" "Accessories"

##################################
# burp suite 1.3.03
##################################

# install
if [ -z "$(ls /usr/share/Infond/bin | grep burp)" ]; then
  rm -r /tmp/burp*
  wget "http://portswigger.net/burp/burpsuite_v1.3.03.zip" -nc -P /tmp
  unzip /tmp/burp* -d /tmp
  rm /tmp/burp*.zip
  mkdir /usr/share/Infond/bin/burp
  mv /tmp/burp*/* /usr/share/Infond/bin/burp/
  log "+" "burp downloaded"
else
  log "I" "burp already in /usr/share/Infond/bin. Not downloaded."
fi

# download icon
downloadicon burp http://www.crazynfunny.com/wp-content/uploads/2010/05/how-to-burp-on-command.gif 

# create burp.sh and add burp.sh shortcut in /usr/bin
addBinEntry burp "java -jar /usr/share/Infond/bin/burp/burp*.jar"

# add entry in Gnome menu
addmenu burp "Burp Suite is free to use for personal and commercial purposes." burp "false" "Pentest"

##################################
# fierce
##################################

if [ -z "$(ls /usr/share/Infond/bin | grep fierce2)" ]; then
  perl -MCPAN -e 'install Net::DNS'
  perl -MCPAN -e 'install Net::hostent'
  svn co https://svn.assembla.com/svn/fierce/fierce2/trunk/ /usr/share/Infond/bin/fierce2/
  chmod +x /usr/share/Infond/bin/fierce2/install.sh
  /usr/share/Infond/bin/fierce2/install.sh
  log "+" "fierce2 installed"
else
  log "I" "fierce2 already in /usr/share/Infond/bin. Not downloaded."
fi
downloadicon fierce2 http://ha.ckers.org/fierce/fiercesmall.jpg

addBinEntry fierce2 "bash -c 'cd /tmp;fierce;echo ex: $ fierce -dns monsite.com;bash'"

addmenu fierce2 "Fierce is a reconnaissance tool written in Perl that quickly scans domains (usually in just a few minutes, assuming no network lag) using a variety of techniques to locate undocumented, internal or just hard-to-find resources via the DNS system." fierce2 "true" "Pentest"


##################################
# wifite
##################################

if [ -z "$(ls /usr/share/Infond/bin | grep wifite)" ]; then
  aptinstall python-tk
  wget http://wifite.googlecode.com/svn/trunk/wifite.py -nc -P /usr/share/Infond/bin
  chmod +x /usr/share/Infond/bin/wifite.py
  log "+" "wifite downloaded"
else
  log "I" "wifite already in /usr/share/Infond/bin. Not downloaded."
fi

downloadicon wifite http://tuxsys.ch/wp-content/uploads/wifi.jpg

addBinEntry wifite "sudo python /usr/share/Infond/bin/wifite.py"

addmenu wifite "to attack multiple WEP and WPA encrypted networks at the same time. this tool is customizable to be automated with only a few arguments. can be trusted to run without supervision." wifite "true" "Transport"




##################################
# webscarab
##################################

# install
if [ -z "$(ls /usr/share/Infond/bin | grep webscarab)" ]; then
  rm -r /tmp/webscarab*
  wget "http://dawes.za.net/rogan/webscarab/webscarab-current.zip" -nc -P /tmp
  unzip /tmp/webscarab-current.zip -d /tmp
  rm /tmp/webscarab-current.zip
  mv /tmp/webscarab* /usr/share/Infond/bin/webscarab/
  rm -r /tmp/webscarab*
  log "+" "webscarab downloaded"
else
  log "I" "webscarab already in /usr/share/Infond/bin. Not downloaded."
fi

# download icon
downloadicon webscarab http://www.think-underground.com/public/logos/owasp.gif 

# create webscarab.sh and add webscarab.sh shortcut in /usr/bin
addBinEntry webscarab "java -jar /usr/share/Infond/bin/webscarab/webscarab.jar"

# add entry in Gnome menu
addmenu webscarab "WebScarab is a framework for analysing applications that communicate using the HTTP and HTTPS protocols." webscarab "false" "Pentest"

##################################
# pdfid.py
##################################

#install
if [ -z "$(ls /usr/share/Infond/bin | grep pdfid)" ]; then
  rm -r /tmp/pdfid*
  wget "https://www.didierstevens.com/files/software/pdfid_v0_0_11.zip" -nc -P /tmp
  unzip /tmp/pdfid_v0_0_11.zip -d /tmp
  rm /tmp/pdfid_v0_0_11.zip
  mv /tmp/pdfid.py /usr/share/Infond/bin/
  ln -s /usr/share/Infond/bin/pdfid.py /usr/bin/pdfid
  log "+" "pdfid downloaded"
else
  log "I" "pdfid already in /usr/share/Infond/bin. Not downloaded."
fi

# download icon
downloadicon pdfid http://3.bp.blogspot.com/_Jna6k5HsSu4/THY4kUhlzkI/AAAAAAAAAIE/ShLrs-iI2rs/s1600/pdf.png

# add to menu
addmenu pdfid "tool for pdf analysis" "bash -c 'cd /tmp;echo example: $ pdfid mypdf.pdf;bash'" "true" pdf 

##################################
# pdf-parser.py
##################################

#install
if [ -z "$(ls /usr/share/Infond/bin | grep pdf-parser)" ]; then
  rm -r /tmp/pdf-parser*
  wget "https://www.didierstevens.com/files/software/pdf-parser_V0_3_7.zip" -nc -P /tmp
  unzip /tmp/pdf-parser_V0_3_7.zip -d /tmp
  rm /tmp/pdf-parser_V0_3_7.zip
  mv /tmp/pdf-parser.py /usr/share/Infond/bin/
  echo "please open a terminal and edit /usr/share/Infond/bin/pdf-parser.py ."
  echo "Then, correct the __maximum_python_version__  to current"
  echo "please press ENTER when done"
  read pause
  ln -s /usr/share/Infond/bin/pdf-parser.py /usr/bin/pdf-parser
  log "+" "pdf-parser downloaded"
else
  log "I" "pdf-parser already in /usr/share/Infond/bin. Not downloaded."
fi

# download icon
downloadicon pdf-parser http://3.bp.blogspot.com/_Jna6k5HsSu4/THY4kUhlzkI/AAAAAAAAAIE/ShLrs-iI2rs/s1600/pdf.png

# add to menu
addmenu pdf-parser "tool for pdf analysis" "bash -c 'cd /tmp;pdf-parser;bash;'" "true" pdf 


##################################
# jmeter 2.4
##################################

# install
if [ -z "$(ls /usr/share/Infond/bin | grep jmeter)" ]; then
  rm -r /tmp/jmeter*
  wget "http://apache.crihan.fr/dist/jakarta/jmeter/binaries/jakarta-jmeter-2.4.tgz" -nc -P /tmp
  tar xzf /tmp/jakarta-jmeter-2.4.tgz -C /tmp
  rm /tmp/*jmeter*.tgz
  mkdir /usr/share/Infond/bin/jmeter
  mv /tmp/*jmeter* /usr/share/Infond/bin/jmeter/
  log "+" "jmeter downloaded"
else
  log "I" "jmeter already in /usr/share/Infond/bin. Not downloaded."
fi

# download icon
downloadicon jmeter http://jakarta.apache.org/jmeter/images/logo.jpg 

# create jmeter.sh and add jmeter.sh shortcut in /usr/bin
addBinEntry jmeter "java -jar /usr/share/Infond/bin/jmeter/jakarta-jmeter-2.4/bin/ApacheJMeter.jar"

# add entry in Gnome menu
addmenu jmeter "Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to make a graphical analysis of performance or to test your server/script/object behavior under heavy concurrent load." jmeter "false" "Pentest"

##################################
# apache2, php, mysql, phpmyadmin
##################################

# install apache and configure for local use only
aptinstall apache2
echo Listen 127.0.0.1:80 > /etc/apache2/ports.conf
echo Listen 127.0.0.1:443 >> /etc/apache2/ports.conf

# php, mysql and phpmyadmin
aptinstall php5
aptinstall libapache2-mod-php5
aptinstall mysql-server 
aptinstall php5-mysql
aptinstall phpmyadmin

# ssl
a2enmod ssl 
make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/localhost.pem
cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
sed -i '1,2s/\*:80/*:443/' /etc/apache2/sites-available/ssl
sed -i "3a\\\tSSLEngine On\n\tSSLCertificateFile /etc/ssl/private/localhost.pem" /etc/apache2/sites-available/ssl
a2ensite ssl

# restart apache
/etc/init.d/apache2 restart


##################################
# rips-scanner 0.35
##################################

# needs apache and php

# install
if [ -z "$(ls /var/www | grep rips)" ]; then
  rm -r /tmp/rips*
  wget "http://sourceforge.net/projects/rips-scanner/files/rips-0.35.zip/download" -nc -P /tmp
  mkdir /var/www/rips
  unzip /tmp/rips-0.35.zip -d /var/www/rips
  chown -R www-data: /var/www/rips 
  chmod 440 -R /var/www/rips
  chmod -R ug+X /var/www/rips
  /etc/init.d/apache2 restart
  rm /tmp/rips*
  log "+" "rips downloaded"
else
  log "I" "rips already in /var/www. Not downloaded."
fi

# download icon
downloadicon rips http://a.fsdn.com/con/icons/ri/rips-scanner@sf.net/rips.png 

# create rips.sh and add rips.sh shortcut in /usr/bin
addBinEntry rips "google-chrome http://127.0.0.1/rips"

# add entry in Gnome menu
addmenu rips "RIPS is a static source code analyser for vulnerabilities in PHP webapplications." rips "false" "Pentest"



##################################
# rubygems
##################################

aptinstall rubygems
export PATH=/var/lib/gems/1.8/bin:$PATH


##################################
# truecrypt-7.0a-linux-x86
##################################

#install
if [ -z "$(ls /usr/share/Infond/bin | grep truecrypt)"  ];then
  wget http://www.truecrypt.org/download/truecrypt-7.0a-linux-x86.tar.gz -nc -P /tmp
  log "+" "truecrypt-7.0 downloaded"
  tar xzf /tmp/truecrypt-7.0a-linux-x86.tar.gz -C /usr/share/Infond/bin/
  rm /tmp/truecrypt-7.0a-linux-x86.tar.gz
  /usr/share/Infond/bin/truecrypt-7.0a-setup-x86
  log "+" "truecrypt-7.0a installed"
else
  log "I" "truecrypt-7.0a already downloaded. Not updated."
fi

# add category to gnome menu
addcategory truecrypt Accessories


##################################
# virtualbox
##################################

# apt install
aptinstall virtualbox-4.0

# add virtualbox to gnome Infond menu
addcategory virtualbox Accessories


##################################
# - paros 3.2.13
##################################

# install
if [ -z "$(ls /usr/share/Infond/bin | grep paros)" ]; then
  rm -r /tmp/paros*
  wget "http://downloads.sourceforge.net/project/paros/Paros/Version%203.2.13/paros-3.2.13-unix.zip" -nc -P /tmp
  unzip /tmp/paros*.zip -d /tmp
  rm /tmp/paros*.zip
  mv /tmp/paros* /usr/share/Infond/bin/paros/
  log "+" "paros downloaded"
else
  log "I" "paros already in /usr/share/Infond/bin. Not downloaded."
fi

# download icon
downloadicon paros http://securitytnt.com/wp-content/uploads/2007/03/paros.png 

# create paros.sh and paros.sh shortcut in /usr/bin
addBinEntry paros "cd /usr/share/Infond/bin/paros;java -jar paros.jar"

# add entry in Gnome menu
addmenu paros "A Java based HTTP/HTTPS proxy for assessing web application vulnerability. It supports editing/viewing HTTP messages on-the-fly. Other featuers include spiders, client certificate, proxy-chaining, intelligent scanning for XSS and SQL injections etc. " paros "false" "Pentest"


##################################
# - metasploit framework
##################################

# install
if [ -z "$(ls /usr/share/Infond/bin | grep framework)"  ];then
  wget http://updates.metasploit.com/data/releases/framework-3.6.0-linux-mini.run -nc -P /tmp
  log "+" "metasploit framework downloaded"
  chmod +x /tmp/framework*
  /tmp/framework*
  log "+" "metasploit framework installed"
else
  log "I" "metasploit framework already downloaded. Not updated."
fi

# download icon
downloadicon msfconsole http://www.metasploit.com/images/hax_small.jpg

# add msfconsole entry in Gnome menu
addmenu msfconsole "The Metasploit Framework is both a penetration testing system and a development platform for creating security tools and exploits." "bash -c 'echo msfconsole;msfconsole -v;msfconsole'" "true" "Pentest" 

###########################
# wipe
###########################

# apt install
aptinstall wipe

# download icon
downloadicon wipe http://i26.tinypic.com/141o2nt.jpg

# add entry in Gnome menu
addmenu wipe "securely erase files from magnetic media." "bash -c 'cd /tmp;wipe -h;bash'" "true" "Accessories"

###########################
# p0f (passive footprinting tool)
###########################

# apt install
aptinstall p0f

# download icon
downloadicon p0f http://www.abcteach.com/free/b/banner3longbnw.jpg

# add entry in Gnome menu
addmenu p0f "identify remote systems passively." "bash -c 'cd /tmp;p0f -h;bash'" "true" "Pentest"



###########################
# socat
###########################

# apt install
aptinstall socat

# download icon
downloadicon socat http://2.bp.blogspot.com/_Jna6k5HsSu4/TFaaYRZYx1I/AAAAAAAAAH0/mwnHBGIMP0U/s1600/socat.png

# add entry in Gnome menu
addmenu socat "Multipurpose relay (SOcket CAT)." "bash -c 'cd /tmp;socat -h;echo ex: socat tcp4-listen:2121,reuseaddr,fork tcp-connect:www.google.com:80;bash'" "true" "Accessories"

###########################
# ascii
###########################

# apt install
aptinstall ascii

# download icon
downloadicon ascii http://ascii-table.com/img/table.gif

# add entry in Gnome menu
addmenu ascii "table ascii." "bash -c 'ascii -h;bash'" "true" "Accessories"


###########################
# john the ripper
###########################

aptinstall john
downloadicon john http://www.tux-planet.fr/public/images/icons/lock-broken.png 
addmenu john "John the Ripper password cracker." "bash -c 'cd /tmp;john;bash'" "true" "Accessories"


###########################
# aircrack-ng
###########################

# apt install
aptinstall aircrack-ng

# download icon
downloadicon aircrack http://www.hebertphp.net/wordpress/wp-content/uploads/2009/07/wifi.jpg 

# add entry in Gnome menu
addmenu aircrack "Aircrack-ng is an 802.11 WEP and WPA-PSK keys cracking program that can recover keys once enough data packets have been captured. It implements the standard FMS attack along with some optimizations like KoreK attacks, as well as the all-new PTW attack, thus making the attack much faster compared to other WEP cracking tools. In fact, Aircrack-ng is a set of tools for auditing wireless networks." "bash -c 'cd /tmp;aircrack-ng --help;bash'" "true" Transport

###########################
# webhttrack
###########################

# apt install
aptinstall webhttrack

# download icon
downloadicon webhttrack http://i757.photobucket.com/albums/xx217/vieand/Screenshot/Logo/Winhttrack.jpg

# add entry in Gnome menu
addmenu webhttrack "webhttrack - offline browser : copy websites to a local directory." "bash -c 'cd /tmp;webhttrack -h;bash'" "true" "Accessories"


###########################
# firefox extensions
###########################

# download and install firefox extensions
firefoxadd firebug 1843
firefoxadd livehttpheaders 3829
firefoxadd noscript 722
firefoxadd flashblock 433
firefoxadd flashgot 220
firefoxadd foxyproxy 2464
firefoxadd certificatepatrol 6415
# installation of useragentswitcher does not work. why????
# must be manually installed
#firefoxadd useragentswitcher 59

# tamper_data-11.0.1-fx
# does not use "latest" address in mozilla repo. 
# We must download specific version.
if [ -z "$(ls -R $extensionDir | grep tamperdata)" ]; then 
  # download
  wget https://addons.mozilla.org/fr/firefox/downloads/file/79565/tamper_data-11.0.1-fx.xpi -nc -P $extensionDir
  # log
  log "+" "tamper_data firefox extension installed."
else
 log "I" "tamper_data already installed. .xpi not downloaded."
fi

# chickenfoot 1.0.7
if [ -z "$(ls -R $extensionDir | grep chickenfoot)" ]; then  
  wget http://groups.csail.mit.edu/uid/chickenfoot/chickenfoot.xpi -nc -P $extensionDir
  log "+" "chickenfoot firefox extension installed."
else
 log "I" "chickenfoot already installed. .xpi not downloaded."
fi

###########################
# conclusion
###########################

# install extensions
firefox -silent -offline

# chmod every other files in Infond
id=$(ls /home)
chown $id:$id /usr/share/Infond -R
chmod -R 744 /usr/share/Infond

# EOF
